import Vue from 'vue'
import Router from 'vue-router'

// 引用模板
import Home from "../views/Home.vue";
import SubmitOrder from "../views/buy/SubmitOrder.vue";
import ConfirmOrder from "../views/buy/ConfirmOrder.vue";
import PaySuccess from "../views/buy/PaySuccess.vue";
import UnitaryBuy from "../views/buy/UnitaryBuy.vue";
import Mine from "../views/my/Mine.vue";
import Order from "../views/my/Order.vue";
import Discounts from "../views/my/Discounts.vue";
import Info from "../views/my/Info.vue";
import Faq from "../views/my/Faq.vue";
import Address from "../views/my/Address.vue";
import CrowdList from "../views/my/CrowdList.vue";
import Invoice from "../views/my/Invoice.vue";
import SecKill from "../views/activity/SecKill.vue";
import CrowdFunding from "../views/activity/CrowdFunding.vue";
import CrowdFundingMain from "../views/activity/CrowdFundingMain.vue";
import DoubleTwelve from "../views/activity/DoubleTwelve.vue";
import OrderDetail from "../views/my/OrderDetail.vue";
import DrawCoupons from "../views/coupon/DrawCoupons.vue";
import DiscountBuy from "../views/buy/DiscountBuy.vue";


Vue.use(Router);

// 配置路由
export default new Router({
  routes: [
    {path: '/', redirect: '/home'},
    {path: '/home', name: 'home', components: {default: Home},},
    /*购买流程*/
    /*提交订单*/
    {path: '/submitOrder', name: "submitOrder", component: SubmitOrder},
    /*订单确认*/
    {path: '/confirmOrder', name: "confirmOrder", component: ConfirmOrder},
    /*支付成功*/
    {path: '/paySuccess', name: "paySuccess", component: PaySuccess},
    /*折扣购买*/
    {path: '/discountBuy', name: "discountBuy", component: DiscountBuy},
    /*我的主页*/
    {path: '/my', name: "mine", component: Mine},
    /*我的订单*/
    {path: '/orderList', name: "mine_order", component: Order},
    /*我的订单明细*/
    {path: '/my/order/detail', name: "mine_orderDetail", component: OrderDetail},
    /*我的优惠*/
    {path: '/my/discounts', name: "mine_discounts", component: Discounts},
    /*我的信息*/
    {path: '/my/info', name: "mine_info", component: Info},
    /** 众筹购买页面 */
    {path: '/my/crowdList', name: "activity_crowdList", component: CrowdList},
    /*我的信息——地址信息*/
    {path: '/my/info/address', name: "mine_info_address", component: Address},
    /*我的信息——发票信息*/
    {path: '/my/info/invoice', name: "mine_info_invoice", component: Invoice},
    /*常见问题*/
    {path: '/my/faq', name: "mine_faq", component: Faq},
    /*双十二活动*/
    {path: '/activity/doubleTwelve', name: "activity_doubleTwelve", component: DoubleTwelve},
    /** 众筹主页 */
    {path: '/activity/crowdFoundingMain', name: "activity_crowdFoundingMain", component: CrowdFundingMain},
    /** 众筹购买页面 */
    {path: '/activity/crowdFounding', name: "activity_crowdFounding", component: CrowdFunding},
    /*秒杀活动*/
    {path: '/secKill', name: "activity_secKill", component: SecKill},
    /*一元专区*/
    {path: '/unitaryBuy', name: "unitaryBuy", component: UnitaryBuy},

    /*代金券领取*/
    {path: '/coupons/draw', name: "drawCoupons", component: DrawCoupons},
  ]
})
